class AreaCarObj {
  String areaName;
  String billNum;
  String carNum;
  String driverName;
  String driverSn;
  int id;
  String loadGoodsName;
  bool online;
  String picId;
  String speed;
  String supercargo;
  String type;
  String vehicleSn;
  String vehicleType;
  String workCompanyName;
  String typeName;

  AreaCarObj(
      {this.areaName,
      this.billNum,
      this.carNum,
      this.driverName,
      this.driverSn,
      this.id,
      this.loadGoodsName,
      this.online,
      this.picId,
      this.speed,
      this.supercargo,
      this.type,
      this.vehicleSn,
      this.vehicleType,
      this.workCompanyName,
      this.typeName});

  factory AreaCarObj.fromJson(Map<String, dynamic> json, String typeName) {
    return AreaCarObj(
      areaName: json['areaName'],
      billNum: json['billNum'],
      carNum: json['carNum'],
      driverName: json['driverName'] ?? "-",
      driverSn: json['driverSn'],
      id: json['id'],
      loadGoodsName: json['loadGoodsName'],
      online: json['online'],
      picId: json['picId'],
      speed: json['speed'] ?? "-",
      supercargo: json['supercargo'],
      type: json['type'],
      vehicleSn: json['vehicleSn'],
      vehicleType: json['vehicleType'],
      workCompanyName: json['workCompanyName'],
      typeName: typeName
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['areaName'] = this.areaName;
    data['billNum'] = this.billNum;
    data['carNum'] = this.carNum;
    data['driverName'] = this.driverName;
    data['driverSn'] = this.driverSn;
    data['id'] = this.id;
    data['loadGoodsName'] = this.loadGoodsName;
    data['online'] = this.online;
    data['picId'] = this.picId;
    data['speed'] = this.speed;
    data['supercargo'] = this.supercargo;
    data['type'] = this.type;
    data['vehicleSn'] = this.vehicleSn;
    data['vehicleType'] = this.vehicleType;
    data['workCompanyName'] = this.workCompanyName;
    return data;
  }
}
